<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <title>会员中心</title>
    <meta name="Keywords" content="书">
    <link href="__PUBLIC__/home/user/css/public.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/home/user/css/returns.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/home/user/css/myyiguo.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/home/user/css/themes.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/home/css/img.css" rel="Stylesheet" type="text/css"/>


    <script src="__PUBLIC__/home/js/jquery.js"></script>
    <script type="text/javascript" src="__PUBLIC__/home/js/jQuery.FormValidator.js"></script>
</head>
    <body id="body">

        <div class="w">
            <div class="site-nav" style="background-color: #e0e0e0">
                <div class="wrap">
                    <ul class="fl">
                        <li>欢迎光临！</li>
                    </ul>

                    <ul class="fr">

                        <li class="mobile">
                            <div class="tit"><a href="__MODULE__/Index/index" style="border: 0;">首页</a></div>

                        </li>

                        <if condition="$V=SESSION('username')">
                            <li  style="">
                                <a rel="nofollow" href="__MODULE__/Collect/index">我的收藏</a>
                            </li>
                            <li style="">
                                <a rel="nofollow" href="__MODULE__/User/index">会员中心</a>
                            </li>
                            <li style="">
                                <a rel="nofollow" href="__MODULE__/Cart/index/goodsNum/1">去购物车</a>
                            </li>
                            <li id="_logout" style="">
                                <a href="__MODULE__/Login/logout" class="logout">[退出]</a>
                            </li>
                            <li style="">
                                <a rel="nofollow"><{$V}></a>
                            </li>
                            <else/>
                            <li id="_register" style="">
                                <a rel="nofollow" href="__MODULE__/Register/index">[注册]</a>
                            </li>
                            <li id="_login" style="">
                                <a rel="nofollow" href="__MODULE__/Login/index">[登录]</a>
                            </li>

                        </if>
                    </ul>
                </div>
            </div>



 
            <div class="wrap">
                    <!--面包屑-->
                    <div class="crumbs"><a class="ml0" href="__MODULE__/index/index">首页</a>&gt;<a href="__MODULE__/User/index" class="j_ygnav">会员中心</a><span class="j_thridcrumbs">&gt;<a href="#" class="on j_thirdnav">修改资料</a></span></div>
                <div class="content myyg">
                        <div class="sub">
                            <div class="menu j_menu">
                                <dl>
                                    <dt>交易信息</dt>
                                    <dd>
                                        <ul>
                                            <li><a href="__MODULE__/Order/myorder">我的订单</a></li>
                                            <li><a href="__MODULE__/Collect/index">我的收藏</a></li>
                                        </ul>
                                    </dd>
                                    <dt>账号信息</dt>
                                    <dd>
                                        <ul>
                                            <li><a href="__MODULE__/User/mod">修改资料</a></li>
                                            <li><a href="__MODULE__/User/pwd">修改密码</a></li>
                                        </ul>
                                    </dd>

                                </dl>
                            </div>
                            <div>
                                <div class="ad" style="height: 308px;">
                                    <a href="#" target="_self" style=""><img src="__PUBLIC__/home/user/imgs/ad.jpg" width="194" height="308"></a>
                                </div>
                            </div>
                        </div>

                    

<div class="main profile">
    <div class="title">个人资料</div>
    <div>
        <div class="sub-tit">基本信息</div>
        <form action="__CONTROLLER__/update" id="personalProfileForm" novalidate="false" method="post" enctype="multipart/form-data">
            <foreach name="user" item="user" >
            <div class="control-group">
                <div class="control-label">头像</div>
                <div class="controls">
                    <script type="text/javascript">
                        function nofind(){

                            var img=event.srcElement;

                            img.src="__PUBLIC__/home/imgs/nophoto.gif";

                            img.onerror=null;

                        }
                    </script>
                    <a href="javascript:;" id="btnUpload">
                        <img style=" width:100px; height:100px;" src="__PUBLIC__/Upload/<{$user.face}>" onerror="nofind();">
                        <input type="file" name="face" accept="image/gif,image/jpeg,image/jpg,image/png">
                    </a>
                </div>
            </div>

            <div class="control-group">
                <div class="control-label"><font color="red">*</font>性别</div>
                <div class="controls">
                    <span class="EidtGroup">
                        <input type="radio" name="sex" value="男" <if condition="$user.sex eq '男'">checked</if> />男
                        <input type="radio" name="sex" value="女" <if condition="$user.sex eq '女'">checked</if> />女
                    </span>
                </div>
            </div>
            <div class="control-group">
                <div class="control-label"><font color="red">*</font>真实姓名</div>
                <div class="controls">
                    <span class="EidtGroup">
                        <input class="input" id="RealName" name="name" type="text" value="<{$user.name}>">
                        <span id="TipUserName0"></span>
                    </span>
                    <span id="RealNameTip" class="onError" style=""></span>

                </div>
            </div>
            
            <div class="control-group">
                <div class="control-label"><font color="red">*</font>手机</div>
                <div class="controls">
                    <span class="EidtGroup">
                        <input type="text" class="input" id="tel" name="tel" value="<{$user.tel}>">
                        <span id="TipMobile"></span>
                    </span>
                    <span id="telTip" class="onError" style=""></span>
                </div>
            </div>
            <div class="control-group">
                <div class="control-label"><font color="red">*</font>地址</div>
                <div class="controls">
                    <span class="EidtGroup">
                        <select name="province" id="province">
                            <option value="">--请选择省--</option>
                        </select>
                        <select name="city" id="city">
                            <option value="">--请选择--</option>
                        </select>
                        <select name="county" id="county">
                            <option value="">--请选择--</option>
                        </select>
                        <select name="xiang" id="xiang">
                            <option value="">--请选择--</option>
                        </select>

                    </span>
                    <span id="Tipprovince"></span>
                    <div><input id="adresse" type="text" class="input" name="adresse" value="<{$user.adresse}>"><span id="Tipadresse"></span></div>

                </div>
            </div>

            <div class="control-group">

            <div class="control-group">
                <div class="controls"><input style="width:70px;height:30px;" class="btn-gn" type="submit"  value="提交" /> </div>
            </div>
            <div><a href="#"><img width="912" height="152" src="__PUBLIC__/home/user/imgs/9288693284380806.jpg"></a></div>
            </div>
            </foreach>
        </form>
    </div>
</div>
</div>
<script type="text/javascript">
    //页面加载成功后，执行函数内的代码
    $(document).ready(function() {
        //验证表单
        $("#personalProfileForm").SetValidateSettings({});
        //验证真实姓名
        $("#RealName").SetValidateSettings({
            FormValidate: {
                Empty: {
                    Value: true,
                    Message: "真实名不能为空"
                }
            },
            Message: {
                Text: {
                    Show: "请输入真实姓名",
                    Success: "输入正确！",
                    Error: "必须输入用户名！",
                    Focus: "正在输入..."
                },
                MessageSpaceHolderID: "TipUserName0"
            }
        });
        //验证手机号
        $("#tel").SetValidateSettings({
            FormValidate: {
                Empty: {
                    Value: true
                },
                Format: {
                    Value: new RegExp("^1[34578][0-9]{9}$"),
                    Message: "手机号格式不正确"
                }
            },
            Message: {
                Text: {
                    Show: "请输入手机号码",
                    Success: "正确！",
                    Error: "必须输入手机号",
                    Focus: "输入中..."
                },
                MessageSpaceHolderID: "TipMobile"
            }
        });
        //验证地址
        $("#province").SetValidateSettings({
            FormValidate: {
                Empty: {
                    Value: true,
                    Message: "请选择你的住址"
                }
            },
            Message: {
                Text: {
                    Show: "请选择你的住址",
                    Success: "格式正确",
                    Error: "这也会错？",
                    Focus: "请选择你的住址"
                },
                MessageSpaceHolderID: "Tipprovince"
            }
        });
        //验证详细地址
        $("#adresse").SetValidateSettings({
            FormValidate: {
                Empty: {
                    Value: true,
                    Message: "详细地址不能为空"
                }
            },
            Message: {
                Text: {
                    Show: "请输入真实地址",
                    Success: "输入正确！",
                    Error: "请输入真实地址！",
                    Focus: "正在输入..."
                },
                MessageSpaceHolderID: "Tipadresse"
            }
        });
    });

</script>
<script type="text/javascript">
$(function(){

//获取省份
$.get("__MODULE__/User/area",{'upid':0},function(msg){
    // 1.msg是对象，将对象遍历拼接成option格式的HTML标签
    var str = '<option value="">--请选择省--</option>';
    for (var i in msg) {
        str += '<option value="'+msg[i]['id']+'">'+msg[i]['name']+'</option>';
    }
    // 2.将拼接好的HTML代码放在select内
    $('#province').html(str);
});

// 省改变事件
$('#province').change(function(){
    // 1.获取值
    var value = $(this).val();
    // 2.获取对应的市
    $.get("__MODULE__/User/area",{'upid':value},function(msg){
        // 1.msg是对象，将对象遍历拼接成option格式的HTML标签
        var str = '<option value="">--请选择--</option>';
        for (var i in msg) {
            str += '<option value="'+msg[i]['id']+'">'+msg[i]['name']+'</option>';
        }
        // 3.将拼接好的HTML代码放在select内
        $('#city').html(str);
    })
});

// 市改变事件
$('#city').change(function(){
     // 1.获取值
     var value = $(this).val();
     // 2.获取对应的县
     $.get("__MODULE__/User/area", {'upid':value}, function(msg){
         // 1.msg是对象，将对象遍历拼接成option格式的HTML标签
         var str = '<option value="">--请选择--</option>';
         for (var i in msg) {
         str += '<option value="'+msg[i]['id']+'">'+msg[i]['name']+'</option>';
         }
         // 3.将拼接好的HTML代码放在select内
         $('#county').html(str);
     })
});

// 县改变事件
$('#county').change(function(){
     // 1.获取值
     var value = $(this).val();
     // 2.获取对应的乡镇
     $.get("__MODULE__/User/area", {'upid':value}, function(msg){
         // 1.msg是对象，将对象遍历拼接成option格式的HTML标签
         var str = '<option value="">--请选择--</option>';
         for (var i in msg) {
         str += '<option value="'+msg[i]['id']+'">'+msg[i]['name']+'</option>';
         }

         $('#xiang').html(str);
    })
});
});

//判断Select默认值
function CheckSel(Voption,Value)
{
    var selected = document.getElementById('province');
    for (var i=0; i<selected.length; i++) {
        if(selected.options[i].value == "2"){
    selected.options[i].selected = true;
    break;
}
}
}

CheckSel("#province",2);

</script>
<link href="__PUBLIC__/home/user/css/profile.css" rel="stylesheet" type="text/css">

            <!------- 页尾 ------>
            <include file="./Public/footer.html" />


</div>

</div>
</body>
</html>